package main

import "fmt"

func main() {
	// 类型包含属性和方法
	// 对象是类型的实例化

	// 声明结构体
	type Student struct {
		sid    int
		name   string
		age    int
		course []string
	}
	//var s Student
	//s.sid = 0
	//s.name = "egon"
	//s.age = 18
	//s.course = []string{"wuli","shuxue"}
	//fmt.Println(s.name)

	//s := new(Student)
	//s.name = "egon"
	//fmt.Println(s.name)

	s1 := Student{
		sid:    1001,
		name:   "egon",
		age:    32,
		course: []string{"chinese"},
	}
	fmt.Println(s1)
}
